/**
 * 
 */
package com.fox.webapp.service.impl;

import java.util.List;

import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fox.webapp.domain.AccountVerifySetting;
import com.fox.webapp.persistent.AccountVerifySettingRepository;
import com.fox.webapp.service.ISettingsService;

/**
 * @author yockii
 *
 */
@Service
public class SettingsService implements ISettingsService {

	@Autowired
	private AccountVerifySettingRepository accountVerifySettingRepository;
	
	/* (non-Javadoc)
	 * @see com.fox.webapp.service.ISettingsService#getAllAccountVerifySettings()
	 */
	@Override
	public List<AccountVerifySetting> getAllAccountVerifySettings() {
		return (List<AccountVerifySetting>) accountVerifySettingRepository.findAll();
	}

	/* (non-Javadoc)
	 * @see com.fox.webapp.service.ISettingsService#addNewAccountVerifySetting(com.fox.webapp.domain.AccountVerifySetting)
	 */
	@Override
	public void addNewAccountVerifySetting(AccountVerifySetting avs) {
		accountVerifySettingRepository.save(avs);
	}

	/* (non-Javadoc)
	 * @see com.fox.webapp.service.ISettingsService#updateAccountVerifySetting(com.fox.webapp.domain.AccountVerifySetting)
	 */
	@Override
	public void updateAccountVerifySetting(AccountVerifySetting avs) {
		accountVerifySettingRepository.save(avs);
	}

	@Override
	public void removeAccountVerifySetting(ObjectId id) {
		accountVerifySettingRepository.delete(id);
	}

	@Override
	public AccountVerifySetting getAccountVerifySetting(ObjectId id) {
		return accountVerifySettingRepository.findOne(id);
	}

}
